import java.util.Scanner;

public class java9 {

        public static void main(String[] args) {
            System.out.println("2~99之间的同构数有：");
            for(int i = 2;i<=99;i++){
                if(isTG(i)){
                    System.out.print(i+" ");
                }
            }
        }

        private static boolean isTG(int x) {
            boolean b = false;
            if(x>=1&&x<=9){
                if(x==(x*x)%10)
                    b = true;
            }else if(x>=10&&x<=99){
                if(x==(x*x%100))
                    b = true;
            }
            return b;
        }
    }

